// src/pages/FundList/FundList.scss

.fund-list-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 8px;


  .page-header {
    margin-bottom: 24px;

    .header-content {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 16px;
      padding: 24px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);

      .header-title {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;

        .header-icon {
          font-size: 32px;
          color: #1890ff;
          animation: pulse 2s infinite;
        }

        h1 {
          margin: 0;
          font-size: 28px;
          font-weight: 700;
          background: linear-gradient(45deg, #1890ff, #722ed1);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          background-clip: text;
        }

        .stock-count-badge {
          .ant-badge-count {
            background: linear-gradient(45deg, #ff4d4f, #ff7a45);
            box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
          }
        }
      }

      .market-stats {
        display: flex;
        gap: 24px;

        .stat-item {
          display: flex;
          align-items: center;
          gap: 8px;
          color: #666;
          font-weight: 500;

          .anticon {
            color: #52c41a;
            animation: flash 1.5s infinite;
          }
        }
      }
    }
  }

  .stock-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;

    .ant-card-body {
      padding: 32px;
    }

    .search-section {
      margin-bottom: 32px;

      .stock-search {
        max-width: 500px;

        .ant-input {
          border-radius: 12px;
          border: 2px solid #e8f4fd;
          background: rgba(255, 255, 255, 0.8);
          font-size: 16px;
          padding: 12px 16px;
          transition: all 0.3s ease;

          &:focus,
          &:hover {
            border-color: #1890ff;
            box-shadow: 0 0 20px rgba(24, 144, 255, 0.2);
            background: rgba(255, 255, 255, 1);
          }
        }

        .ant-btn {
          border-radius: 12px;
          height: 50px;
          background: linear-gradient(45deg, #1890ff, #36cfc9);
          border: none;
          box-shadow: 0 4px 15px rgba(24, 144, 255, 0.3);
          transition: all 0.3s ease;

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(24, 144, 255, 0.4);
          }
        }
      }
    }

    .loading-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 400px;

      .ant-spin {
        .ant-spin-dot {
          i {
            background: linear-gradient(45deg, #1890ff, #722ed1);
          }
        }

        .ant-spin-text {
          font-size: 16px;
          color: #666;
          margin-top: 16px;
        }
      }
    }

    .table-container {
      .stock-table {
        .ant-table {
          background: transparent;

          .ant-table-thead > tr > th {
            background: linear-gradient(45deg, #f0f9ff, #e6f7ff);
            border: none;
            font-weight: 600;
            color: #1890ff;
            font-size: 14px;
            padding: 16px 12px;

            &:first-child {
              border-top-left-radius: 12px;
            }

            &:last-child {
              border-top-right-radius: 12px;
            }
          }

          .ant-table-tbody > tr {
            transition: all 0.3s ease;

            &:hover {
              background: rgba(24, 144, 255, 0.05) !important;
              transform: scale(1.01);
              box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            }

            &.positive-row {
              background: rgba(255, 77, 79, 0.05);
              border-left: 3px solid #ff4d4f;
            }

            &.negative-row {
              background: rgba(82, 196, 26, 0.05);
              border-left: 3px solid #52c41a;
            }

            &.neutral-row {
              background: rgba(0, 0, 0, 0.02);
              border-left: 3px solid #d9d9d9;
            }

            > td {
              border: none;
              padding: 12px;
              font-size: 13px;
            }
          }
        }

        .ant-pagination {
          margin-top: 32px;
          text-align: center;

          .ant-pagination-item {
            border-radius: 8px;
            border: 2px solid #e8f4fd;

            &.ant-pagination-item-active {
              background: linear-gradient(45deg, #1890ff, #36cfc9);
              border-color: #1890ff;

              a {
                color: white;
              }
            }
          }
        }
      }
    }
  }
}

// 表格单元格样式
.index-cell {
  font-weight: 600;
  color: #666;
  text-align: center;
}

.fund-info-cell {
  .fund-code {
    .code-link {
      font-weight: 700;
      font-size: 14px;
      color: #1890ff;
      text-decoration: none;
      cursor: pointer;
      transition: all 0.3s ease;

      &:hover {
        color: #40a9ff;
        text-shadow: 0 0 8px rgba(24, 144, 255, 0.3);
      }
    }
  }

  .fund-name {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
  }
}

.action-buttons {
  display: flex;
  gap: 8px;

  .buy-button {
    background: linear-gradient(45deg, #52c41a, #73d13d);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
    color: #fff;
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
    }
  }

  .sell-button {
    background: linear-gradient(45deg, #ff4d4f, #ff7875);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
    color: #fff;
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
    }
  }
}

// 渲染涨跌/增长率、净值文本
.positive-text {
  color: #ff4d4f;
  font-weight: 600;
}

.negative-text {
  color: #52c41a;
  font-weight: 600;
}

.neutral-text {
  color: #666;
  font-weight: 500;
}

.price-text {
  font-weight: 700;
  font-size: 14px;
}

.change-tag {
  border-radius: 12px;
  font-weight: 600;

  &.positive {
    background: linear-gradient(45deg, #ff4d4f, #ff7875);
    color: white;
    border: none;
  }

  &.negative {
    background: linear-gradient(45deg, #52c41a, #73d13d);
    color: white;
    border: none;
  }

  &.neutral {
    background: #f5f5f5;
    color: #666;
  }
}

.amount-text {
  font-weight: 600;
  color: #722ed1;
}

// 弹窗样式
.trade-modal {
  .ant-modal-content {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);

    .ant-modal-header {
      background: linear-gradient(45deg, #1890ff, #36cfc9);
      border: none;
      padding: 24px;

      .modal-title {
        display: flex;
        align-items: center;
        gap: 12px;
        color: white;
        font-size: 18px;
        font-weight: 600;
        margin: 0;

        .anticon {
          font-size: 20px;
        }
      }
    }

    .ant-modal-body {
      padding: 32px;

      .stock-info-modal {
        background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 24px;
        border: 1px solid rgba(24, 144, 255, 0.2);

        .selected-stock {
          text-align: center;

          .stock-code {
            font-size: 24px;
            font-weight: 700;
            color: #1890ff;
            margin-bottom: 8px;
          }

          .stock-name-modal {
            font-size: 16px;
            color: #666;
            margin-bottom: 12px;
          }

          .current-price {
            font-size: 20px;
            font-weight: 700;
            color: #ff4d4f;
            background: rgba(255, 77, 79, 0.1);
            padding: 8px 16px;
            border-radius: 8px;
            display: inline-block;
            margin-bottom: 8px;
          }
        }
      }

      .trade-form {
        max-width: 320px;
        margin: 0 auto;

        .ant-form-item-label > label {
          font-weight: 600;
          color: #333;
        }

        .ant-input-number {
          width: 100%;
          border-radius: 8px;
          border: 1px solid #d9d9d9;
          padding: 8px;
          font-size: 14px;
          transition: border-color 0.3s ease;

          &:hover {
            border-color: #1890ff;
          }

          &:focus-within {
            border-color: #1890ff;
            box-shadow: 0 0 8px rgba(24, 144, 255, 0.2);
          }
        }

        .ant-btn {
          margin-top: 16px;
          width: 100%;
          background: linear-gradient(45deg, #1890ff, #36cfc9);
          border: none;
          color: #fff;
          border-radius: 8px;
          font-weight: 600;
          height: 40px;
          transition: all 0.3s ease;

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
          }
        }
      }
    }
  }
}

// 动画效果
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes flash {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
